
import './lib/flexible.js'
import './assets/iconfont/iconfont'

import Vue from 'vue'
import App from './App'
import router from './router'

import util from './lib/util'
import fastclick from 'fastclick'
fastclick.attach(document.body)
// import Vconsole from 'vconsole'
//   new Vconsole()
import './lib/BeAlert-master/BeAlert.js'
import './lib/BeAlert-master/BeAlert.css'

import './assets/vue-touch.js'

import Mint from 'mint-ui'
Vue.use(Mint)
import { MessageBox,Toast } from 'mint-ui';
window.toast=Toast
window.messageBox=MessageBox
import store from './store'

Vue.use(util)

import '../node_modules/vue-awesome-swiper/node_modules/swiper/dist/css/swiper.css'
import VueAwesomeSwiper from 'vue-awesome-swiper'

Vue.use(VueAwesomeSwiper)



// 注册一个全局自定义指令 v-focus
Vue.directive('focus', {
  // 当绑定元素插入到 DOM 中。
  inserted: function (el) {
    // 聚焦元素
    el.focus()
  }
})

import "babel-polyfill"


Vue.config.productionTip = false
 router.beforeEach((to, from, next) => {
  // 统计代码
   if (to.path) {
     _hmt.push(['_trackPageview', '/#' + to.fullPath]);
   }
    let nowTime=new Date().getTime()
    let endTime=new Date('2019/1/2 23:59:59').getTime()
    if(nowTime>endTime&&to.path!=='/end'){
      next('/end')
      return
    }else{
      next()
    }
 })

var data = {config:{currentPeriod:{},nextPeriod:{},periodList:[],gradeList:[],subjectList:[]}}
///ios兼容提示
try{
  window.localStorage.setItem('testSafari','true');
}catch(err){
  alert("本地储存写入错误，若为safari浏览器请关闭无痕浏览。");
}

new Vue({
  el:'#app',
  router,
  template: '<App/>',
  components: { App },
  data:data,
  store,
})






